package modelr

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Name string `gorm:"type:varchar(30)" json:"name"`
	Pass string `gorm:"type:varchar(100)" json:"pass"`
}
type Engin struct {
	gorm.Model
	Title    string `gorm:"type:varchar(30)" json:"title"`
	Cont     string `gorm:"type:varchar(100)" json:"cont"`
	Img      string `gorm:"type:varchar(50)" json:"img"`
	EnginNum int    `gorm:"type:int" json:"engin-num"`
	UserID   int    `gorm:"type:int" json:"user_id"`
	User     User   `gorm:"foreignKey:UserID" json:"user"`
}
type Like struct {
	gorm.Model
	UserID  int   `gorm:"type:int" json:"user_id"`
	User    User  `gorm:"foreignKey:UserID" json:"user"`
	EnginID int   `gorm:"type:int" json:"Engin_id"`
	Engin   Engin `gorm:"foreignKey:EnginID" json:"engin"`
}
type Follow struct {
	gorm.Model
	UserID  int   `gorm:"type:int" json:"user_id"`
	User    User  `gorm:"foreignKey:UserID" json:"user"`
	EnginID int   `gorm:"type:int" json:"Engin_id"`
	Engin   Engin `gorm:"foreignKey:EnginID" json:"engin"`
}
